package main

import (
	"log"
	"netfly/serv"
	"strconv"

	"github.com/pelletier/go-toml"
)

func main() {
	log.Println("netfly server start...")
	tConf, err := toml.LoadFile("./netflys.toml")
	if err != nil {
		log.Println("Config File Load Error,", err.Error())
		return
	}

	strServIP := tConf.Get("Server.IP").(string)
	strDataPort := strconv.Itoa(int(tConf.Get("Server.DataPort").(int64)))
	strCtrlPort := strconv.Itoa(int(tConf.Get("Server.CtrlPort").(int64)))

	go serv.RunDataServer(strServIP + ":" + strDataPort)
	serv.RunCtrlServer(strServIP + ":" + strCtrlPort)
}
